#!/usr/bin/python
# -*- coding: utf-8 -*-

#-------------------------------------------------
#Create At: 2009-1-12 上午01:07:44 
#Create By: Fla.sam
#
#DESC: 
#
#-------------------------------------------------



from CoreApp.models import UserProfile
from django.contrib.auth.models import Group
from django.db import models
from utils import ZhAutoSlugField

# Create your models here.
class NewsArticle( models.Model ):
    
    news_title = models.CharField( verbose_name='标题', help_text='站点新闻标题', max_length=100 )
    news_content = models.TextField( verbose_name='内容', help_text='站点新闻内容', max_length=2000 )
    news_for_usergroup = models.ManyToManyField( Group, verbose_name='可读用户组', help_text='指定可以阅读本条新闻的用户组', blank=True )
    news_slug = ZhAutoSlugField(populate_from='news_title')

    def __unicode__( self ):
        return u'%s slug: %s' % (self.news_title , self.news_slug)
    class Meta:
        verbose_name = u'站点新闻'
        verbose_name_plural = u'%s管理' % verbose_name
    